package com.lc202406;

public class Solution55 {
    public boolean canJump(int[] nums) {
        //  能够到达的最远位置
        int position = 0;
        int length = nums.length;
        for (int i = 0; i < length; i++) {
            // i是当前位置
            if (i > position) {
                return false;
            }
            position = Math.max(i + nums[i], position);
        }
        return true;
    }
}
